<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">

<head th:replace="index::head">

</head>

<body>
    <ul class="layui-nav" th:replace="index::nav">
    </ul>

    <div>
        <div style="text-align: center;background-color: #4191C2;color: white;height: 150px;">
            <h1 style="padding: 50px">薪资发放</h1>
        </div>
    </div>
    <div style="margin-top: 40px;">
        <div class="layui-container">
            <form class="layui-form" lay-filter="testform">
                <div class="layui-form-item">
                     <label class="layui-form-label">员工编号</label>
                     <div class="layui-input-block">
                       <input type="text" name="userId" th:value="${userId}" readonly  lay-verify="required" placeholder="请输入员工编号" autocomplete="off" class="layui-input">
                     </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">基础工资</label>
                    <div class="layui-input-block">
                        <input type="text" name="base" value="" required lay-verify="required" placeholder="请输入基础工资"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">津贴</label>
                    <div class="layui-input-block">
                        <input type="text" name="bonus" value="" required lay-verify="required" placeholder="请输入津贴"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">月份信息</label>
                    <div class="layui-input-block">
                        <input type="text" name="month" value="" required lay-verify="required" placeholder="请输入月份信息"
                            autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <button type="reset" id="resetBtn" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</body>
<script>
    layui.use(['layer'], function (args) {
        var layer = layui.layer;
        var form = layui.form;
        form.on('submit(formDemo)', function (data) {
            $.post("/salary",data.field,function(data){
                if(data.code===200){
                    layer.msg('操作成功！'); 
                    $('#resetBtn').click();
                }
            })
            return false;
        });
    }); 
</script>

</html>